package com.hans.cloud.helloserver.openfeign;

import com.hans.cloud.api.service.UserServiceAPI;
import com.hans.cloud.api.utils.R;
import com.hans.cloud.helloserver.domain.UserDO;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RestController;

/**
 * userServie的具体实现
 */
@RestController
public class UserOpenfeign implements UserServiceAPI {

    @Value("${server.port}")
    private int port;

    @Override
    public R get(Long id) {
        UserDO user=new UserDO();
        user.setUserId(id);
        user.setUsername("port:"+port);
        user.setName("我是openfeign呀");
        return R.ok().put("data",user);
    }
}
